package com.wys.mall.cart.vo;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 购物项
 * @Package com.wys.mall.cart.vo
 * @Author charlin
 * @Version: v1.0
 * @Date 2021-07-089:15
 * @Copyright: 2021 www.wyscha.com Inc. All rights reserved.
 */
//@Data
public class CartItem implements Serializable {
    /**商品Id*/
    private Long skuId;
    /**是否选中*/
    private Boolean check = true;
    /**标题*/
    private String title;
    /**图片*/
    private String image;
    /**产品属性*/
    private List<String> skuAttr;
    /**价格信息*/
    private BigDecimal price;
    /**产品数量*/
    private Integer count;
    /**价格总计*/
    private BigDecimal totalPrice;




    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public Boolean getCheck() {
        return check;
    }

    public void setCheck(Boolean check) {
        this.check = check;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public List<String> getSkuAttr() {
        return skuAttr;
    }

    public void setSkuAttr(List<String> skuAttr) {
        this.skuAttr = skuAttr;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    /**计算总价*/
    public BigDecimal getTotalPrice() {
        return this.price.multiply(new BigDecimal(this.count));
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }
}
